<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

//网约车平台公司基础信息接口
Route::group([
	'middleware' => 'jwt.api.auth',
    // 'prefix' => 'login'

], function () {
	
	Route::any('pay/statement', 'PayController@statement');  //个人版钱包  需要传参数 : 用户ID=>uid
	Route::any('pay/card', 'PayController@card');  //个人版出行卡  需要传参数 : 用户ID=>uid
	Route::any('pay/buycard', 'PayController@buycard');  //个人版购买出行卡 需要传参数 : 要购买的出行卡列表ID=>card_id ,购卡总金额=>money ,购买人用户ID=>uid,购买数量=>cardnum
	Route::any('pay/sendcard', 'PayController@sendcard');  //个人版赠送出行卡 需要传参数 : 赠送的出行卡ID=>card_id ,赠送人用户ID=>buy_userid ,受赠人手机号=>phone
	Route::any('pay/wakecard', 'PayController@wakecard');  //个人版绑定出行卡 需要传参数 : 绑定的出行卡ID=>card_id ,绑定用户ID=>uid
	
	Route::any('wechat/ordersave','WechatController@ordersave');  //微信支付结果查询后操作
	Route::any('wechat/orderselect','WechatController@orderselect');  //微信支付手动结果查询
	// Route::any('api/wechat/businesspay','Api\WechatController@businessPay');
	
	Route::any('wechat/wxpayNotify','WechatController@wxpayNotify');  //微信app微信回调地址
	Route::any('setorder/paywx', 'SetorderController@paywx');  //小程序支付
	//小程序支付回掉
	Route::any('notify', 'APi\WeiXinXPayController@notifyPay');

});
	Route::any('login/code', 'LoginController@code');  //企业版登录验证码  需要传参数 : 用户手机号=>phone
	Route::any('login/code1', 'LoginController@code1');  //个人版登录验证码  需要传参数 : 用户手机号=>phone
	Route::any('login/login', 'LoginController@login');  //企业版登录  需要传参数 : 用户手机号=>phone ,企业简称=>short_name(如果企业未注册过)
	Route::any('login/login2', 'LoginController@login2');  //个人版登录  需要传参数 : 用户手机号=>phone
	Route::any('login/xieyi', 'LoginController@xieyi');  //个人版注册协议
	
Route::any('wechat/WeiXinAppPay','WechatController@WeiXinAppPay');  //微信app支付发起  需要传参数 : 用户ID=>uid ,充值金额=>money
	//得到预支付交易单
	Route::any('prepay_id', 'WeiXinXPayController@requestPayment');
	



// Route::any('setorder/busrider', 'SetorderController@busrider');  //历史乘车人
Route::any('setorder/chosecity', 'SetorderController@chosecity');  //选择城市
Route::any('setorder/carserver', 'SetorderController@carserver');  //返回车系
// Route::any('setorder/order', 'SetorderController@order');  //下单
Route::any('setorder/price', 'SetorderController@price');  //计算价格

Route::any('setorder/getOpenid', 'SetorderController@getOpenid');  //小程序支付授权
Route::any('setorder/upload', 'SetorderController@upload');  //小程序支付授权
Route::any('setorder/orderlist', 'SetorderController@orderlist');  //小程序支付授权
//订单接口
Route::group([
	'middleware' => 'jwt.api.auth',
    // 'prefix' => 'setorder'

], function () {

	Route::any('setorder/busrider', 'SetorderController@busrider');  //历史乘车人
	Route::any('setorder/test', 'SetorderController@test');  //测试
	
	Route::any('setorder/order', 'SetorderController@order');  //下单
	
	Route::any('setorder/zhifubao', 'SetorderController@zhifubao');  //支付宝
	Route::any('setorder/orderlist', 'SetorderController@orderlist');  //订单列表
	Route::any('setorder/cipPrice', 'SetorderController@cipPrice');  //cip
	Route::any('setorder/canUseMoney', 'SetorderController@canUseMoney');  //企业或者个人的剩余可用金额，接送机次数，剩余企业分配的金额
	Route::any('setorder/teseRout', 'SetorderController@teseRout');  //已开放的特色线路
	Route::any('setorder/dingzhiRout', 'SetorderController@dingzhiRout');  //已开放的定制用车
	Route::any('setorder/ali_pay', 'SetorderController@ali_pay'); 
});
 
//订单接口
Route::group([
	'middleware' => 'jwt.api.auth',
    'prefix' => 'order'

], function () {
	Route::any('waitreceipt', 'OrderController@waitReceipt');
    Route::any('orderprocess','OrderController@orderProcess');
	Route::any('serverend','OrderController@serverEnd');
	Route::any('cancelorder','OrderController@cancelOrder');

});

//sk 钱包个人余额
/*Route::group([
    'middleware' => 'jwt.api.auth',
], function () {
    Route::any('wallet/balance', 'WalletController@balance');  //钱包个人余额
})*/


Route::any('personal/uploadPhoto', 'PersonalController@uploadPhoto');  //图片上传

//sk  个人中心
Route::group([
    'middleware' => 'jwt.api.auth',
], function () {
    Route::any('personal/sidebar', 'PersonalController@sidebar');  //个人中心sidebar
    Route::any('personal/edit', 'PersonalController@edit');  //个人中心资料编辑
    Route::any('personal/terms', 'PersonalController@terms');  //设置条款
    Route::any('personal/about', 'PersonalController@about');  //关于时代出行
    Route::any('personal/push', 'PersonalController@push');  //消息推送
    Route::any('personal/logout', 'PersonalController@logout');  //退出登录
   // Route::any('personal/uploadPhoto', 'PersonalController@uploadPhoto');  //图片上传
});

Route::any('personal/test', 'PersonalController@test');  //图片上传